package com.ywu.application.standard.demandManagement.api;

import com.ywu.common.result.CommonResult;
import com.ywu.application.standard.demandManagement.dto.YwuDemandManageProjectDto;
import com.ywu.application.standard.demandManagement.dto.YwuDemandManageProjectGroupDto;
import com.ywu.application.standard.demandManagement.dto.YwuDemandManageProjectVersionDto;
import com.ywu.application.standard.demandManagement.service.YwuDemandManageProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuDemandManageProjectApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2025/3/31 13:29
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/demand/manage/project")
public class YwuDemandManageProjectApi {

    @Autowired
    private YwuDemandManageProjectService service;

    /**
    * @Author GroundDemo
    * @Description 分页查询项目信息
    * @Date 13:31 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.list.info")
    public CommonResult<Object> queryProjectList(@RequestBody YwuDemandManageProjectDto dto) {
        return service.queryProjectList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询当前用户参与的项目列表
    * @Date 14:13 2025/4/5
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.user.list.info")
    public CommonResult<Object> queryProjectListByUser(@RequestBody YwuDemandManageProjectDto dto) {
        return service.queryProjectListByUser(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 创建项目
    * @Date 13:33 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.create.info")
    public CommonResult<Object> createProject(@RequestBody YwuDemandManageProjectDto dto) {
        return service.createProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改项目
    * @Date 13:35 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.update.info")
    public CommonResult<Object> updateProject(@RequestBody YwuDemandManageProjectDto dto) {
        return service.updateProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除项目
    * @Date 13:41 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.delete.info")
    public CommonResult<Object> deleteProject(@RequestBody YwuDemandManageProjectDto dto) {
        return service.deleteProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询项目组成员信息
    * @Date 14:00 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.group.list.info")
    public CommonResult<Object> queryProjectGroupList(@RequestBody YwuDemandManageProjectGroupDto dto) {
        return service.queryProjectGroupList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 添加项目组用户
    * @Date 14:05 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.group.create.info")
    public CommonResult<Object> addGroupUser(@RequestBody YwuDemandManageProjectGroupDto dto) {
        return service.addGroupUser(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除项目组用户
    * @Date 14:27 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.group.delete.info")
    public CommonResult<Object> deleteGroupUser(@RequestBody YwuDemandManageProjectGroupDto dto) {
        return service.deleteGroupUser(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询项目版本
    * @Date 14:34 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.version.list.info")
    public CommonResult<Object> queryProjectVersionList(@RequestBody YwuDemandManageProjectVersionDto dto) {
        return service.queryProjectVersionList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 添加项目版本
    * @Date 14:57 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.version.create.info")
    public CommonResult<Object> createProjectVersion(@RequestBody YwuDemandManageProjectVersionDto dto) {
        return service.createProjectVersion(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改项目版本信息
    * @Date 15:10 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.version.update.info")
    public CommonResult<Object> updateProjectVersion(@RequestBody YwuDemandManageProjectVersionDto dto) {
        return service.updateProjectVersion(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除项目版本信息
    * @Date 15:21 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.version.delete.info")
    public CommonResult<Object> deleteProjectVersion(@RequestBody YwuDemandManageProjectVersionDto dto) {
        return service.deleteProjectVersion(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 项目版本下拉查询
    * @Date 21:53 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/project.version.dropdown.info")
    public CommonResult<Object> queryVersionListForDropDown(@RequestBody YwuDemandManageProjectVersionDto dto) {
        return service.queryVersionListForDropDown(dto);
    }
}
